<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>去除末尾的零</title>
</head>
<body>
    <script>
       
        {
            // input: 20500    output: 205
            // input: 10000    output: 1
            let num = 205000;

            function removeEndZeros (num) {
                let str = num + '';
                let reg = /0+$/g;
                return str.replace(reg,'');
            }

        }


    
    
    </script>
</body>
</html>